# encoding: utf-8
"""
Input arguments (Parameters) for zones resources RESTful API
-----------------------------------------------------------
"""

from flask_marshmallow import base_fields
from flask_restplus_patched import Parameters
from flask_restplus_patched import PostFormParameters, PatchJSONParameters

from . import schemas


class AppsParameters(Parameters):
    zone_code = base_fields.String(
        description = "数据中心编码",
        missing = None,  # default value
    )


class InitZoneAppsParameters(Parameters):
    zone_codes = base_fields.String(
        description = "数据中心编码列表,逗号隔开",
        missing = None,  # default value
        required = False,
    )


class AppKillParameters(Parameters):
    pass


class AppsPackageParameters(Parameters):
    package_path = base_fields.String(
        description = "",
        missing = None,  # default value
        required = True,
    )


class AppsLoggingParameters(Parameters):
    log_type = base_fields.String(
        description = "日志类型，必填项，可选值（app, pip-app, pip-db)",
        missing = None,  # default value
        required = True,
    )

    log_lines = base_fields.Integer(
        description = "显示最后日志行数，必填项",
        missing = 200,  # default value
        required = True,
    )


class ZoneParameters(Parameters):
    zone_code = base_fields.String(
        description = "数据中心编码",
        required = True
    )


class AutoTestParameters(Parameters):
    account = base_fields.String(
        description = "执行测试的用户名",
        required = True
    )


# 启动应用参数，默认区域为四个
class StartAppParameters(Parameters):
    zone_code = base_fields.String(
        description = "数据中心编码,多个用逗号隔开",
        required = False,
        missing = 'uc.gzidc.area,uc.gzidc.warehouse.szx,uc.usaws.area,uc.usaws.warehouse.usla'
    )


# 安装应用参数，默认所有区域
class InstallAppParameters(Parameters):
    zone_code = base_fields.String(
        description = "数据中心编码,多个用逗号隔开",
        required = False,
        missing = None
    )
